Cleanup some docs (includes/*.php)
[lhc/web/wiklou.git] / includes / StubObject.php
index 6508bce..73952da 100644 (file)
@@ -83,9 +83,9 @@ class StubObject {
         * @param object $obj Object to check.
         * @return void
         */
-       static function unstub( $obj ) {
+       static function unstub( &$obj ) {
                if ( $obj instanceof StubObject ) {
-                       $obj->_unstub( 'unstub', 3 );
+                       $obj = $obj->_unstub( 'unstub', 3 );
                }
        }
 
@@ -134,6 +134,7 @@ class StubObject {
         * @param string $name Name of the method called in this object.
         * @param int $level Level to go in the stack trace to get the function
         *   who called this function.
+        * @return object The unstubbed version of itself
         * @throws MWException
         */
        function _unstub( $name = '_unstub', $level = 2 ) {
@@ -157,39 +158,11 @@ class StubObject {
                        $GLOBALS[$this->global] = $this->_newObject();
                        --$recursionLevel;
                        wfProfileOut( $fname );
+                       return $GLOBALS[$this->global];
                }
        }
 }
 
-/**
- * Stub object for the content language of this wiki. This object have to be in
- * $wgContLang global.
- *
- * @deprecated since 1.18
- */
-class StubContLang extends StubObject {
-
-       function __construct() {
-               wfDeprecated( __CLASS__, '1.18' );
-               parent::__construct( 'wgContLang' );
-       }
-
-       function __call( $name, $args ) {
-               return $this->_call( $name, $args );
-       }
-
-       /**
-        * @return Language
-        */
-       function _newObject() {
-               global $wgLanguageCode;
-               $obj = Language::factory( $wgLanguageCode );
-               $obj->initEncoding();
-               $obj->initContLang();
-               return $obj;
-       }
-}
-
 /**
  * Stub object for the user language. It depends of the user preferences and
  * "uselang" parameter that can be passed to index.php. This object have to be